pocketmodsfandomcom-20200213-history
More lucky blocks . mod You can study on!
ModPE functions! and mod You can learn on! Some of great basic functions are: ♦ Block.defineBlock(id,"name",[subx6]); ♦ ModPE.setItem(id."texture",sub,"name"); Functions: ♦ function useItem(x, y, z, itemid, blockid, side, itemDamage, blockDamage){} // ♦ function destroyBlock(x, y, z, side){} //Blue lucky block by PatrikXop //version 0.0.4 //Used for minecraft version 0.12 - 0.13! //APLAY TEXTURE FIRST!! Block.defineBlock(249, "§1Blue Lucky Block", [0,0,0,0,0,0] ); Block.defineBlock(248, "§4Red lucky block", [0,0,0,0,0,0]); Block.defineBlock(247, "§2Green lucky block", ["green",0,"green",0,"green",0,"green",0,"green",0,"green",0,]); Block.defineBlock(240, "§1Ultimateve §4lucky §2block,", [0,0,0,0,0,0]); Block.defineBlock(239, "§8Evil Block", ["evilBlock",0,"evilBlock",0,"evilBlock",0,"evilBlock",0,"evilBlock",0,"evilBlock",0]); ModPE.setItem(600,"luckyEssence",0,"Lucky essence"); Block.setDestroyTime(240, 0.7); Block.setDestroyTime(247, 0.5); Block.setDestroyTime(249, 0.5); Block.setDestroyTime(248, 0.5); Block.setDestroyTime(239, 0.5); //destroy time Item.setMaxDamage(600, 90); //max dmg to item Item.addShapedRecipe(600,1,0,[ "ggg", "nan", "ggg" ],"g",266,0,"n",371,0,"a",322,0,); Item.addCraftRecipe(244,1,0,245,3,0,249,1,0,248,1,0,247,1,0,245,3,0); Item.addCraftRecipe(249, 1, 0,8, 0, 22, 1, 0); //crafting recipe 8x goldingot + 1x lapisblock Item.addCraftRecipe(248, 1, 0,8, 0, 152, 1, 0); //8x goldingot and 1x redstone block Item.addCraftRecipe(247, 1, 0,8, 0, 81, 1, 0); //8x goldingot and 1x cactus function destroyBlock(x, y, z, side){ var carry = Player.getCarriedItem(); var dmg = Player.getCarriedItemData(); var block = Level.getTile(x, y, z); if (block 249){ preventDefault(); Level.setTile(x, y, z, 0); var rnd = random(0, 23); //random nubmer generator(var) if (rnd 0){ Entity.addEffect(getPlayerEnt() ,12, time, level); } else if(rnd 1){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 1, time, level); } else if(rnd 2){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 2, time, level); } else if(rnd 3){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 3, time, level); } else if(rnd 4){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 4, time, level); } else if(rnd 5){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 5, time, level); } else if(rnd 6){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 6, time, level); } else if(rnd 7){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 7, time, level); } else if(rnd 8){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 8, time, level); } else if(rnd 9){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 9, time, level); } else if(rnd 10){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 10, time, level); } else if (rnd 11){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 11, time, level); } else if(rnd 13){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 13, time, level); } else if(rnd 14){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 14, 600, 4); } else if(rnd 16){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 16, time, level); } else if(rnd 17){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 17, time, level); } else if(rnd 15){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 15, time, level); } else if(rnd 18){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 18, time, level); } else if(rnd 19){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 19, time, level); } else if(rnd 20){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 20, time, level); } else if(rnd 21){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 22, time, level); } else if(rnd 22){ var level = random(1,3); var time = random(400,1600); Entity.addEffect(getPlayerEnt() , 19, time, level); //potion effects } } else if (block 248){ preventDefault(); Level.setTile(x, y, z, 0); var rnd = random(0, 6); if (rnd 0){ Level.dropItem(x,y,z,0,248,1,0); //drops lucky block back } else if(rnd 1){ var rnd = random(0, 5); Level.dropItem(x,y,z,0,42,rnd,0); //drops 0-5 iron blocks, and bull sh*t Level.dropItem(x,y,z, 0,293,3,0); Level.dropItem(x,y,z, 0,419,2,0); Level.dropItem(x,y,z, 0,2,6,0); Level.dropItem(x,y,z, 0,6,5,0); Level.dropItem(x,y,z, 0,13,6,0); Level.dropItem(x,y,z, 0,18,7,0); Level.dropItem(x,y,z, 0,30,2,0); } else if(rnd 2){ Level.dropItem(x,y,z, 0,51,1,0); Level.dropItem(x,y,z, 0,50,7,0); //drops fier :D, iron sword and torch x7 Level.dropItem(x,y,z, 0,267,1,0); } else if(rnd 3){ Level.dropItem(x,y,z, 0,46,3,0); //drops tnt, wallsings, snow block 80 and stone with silwerfish Level.dropItem(x,y,z, 0,97,5,0); Level.dropItem(x,y,z, 0,80,3,0); Level.dropItem(x,y,z, 0,68,4,0); } else if(rnd 4){ Level.dropItem(x+3,y+2,z+4,0,49,1,0); Level.dropItem(x-5,y+3,z+6,0,49,1,0); Level.dropItem(x+7,y+2,z+3,0,49,1,0); Level.dropItem(x-2,y+4,z+5,0,49,1,0); //drops obsidiand all over the place Level.dropItem(x-2,y+4,z+7,0,49,1,0); } else if(rnd 5){ var cx = getPlayerX(); var cy = getPlayerY(); var cz = getPlayerZ(); Level.dropItem(); Level.setTile(cx,cy,cz-1,97,0); Level.setTile(cx+1,cy,cz,97,0); Level.setTile(cx-1,cy,cz,97,0); Level.setTile(cx,cy-1,cz+1,97,0); Level.setTile(cx,cy-1,cz-1,97,0); Level.setTile(cx,cy+1,cz-1,97,0); Level.setTile(cx,cy-2,cz,97,0); Level.setTile(cx,cy+1,cz,97,0); Level.setTile(cx,cy+1,cz+1,97,0); Level.setTile(cx,cy,cz+1,97,0); Level.setTile(cx,cy+1,cz-1,97,0); Level.setTile(cx+2,cy-1,cz,97,0); Level.setTile(cx-2,cy-1,cz,97,0); Level.setTile(cx,cy-1,cz+2,97,0); Level.setTile(cx,cy-1,cz-2,97,0); //puts stone with silwerfish near player clientMessage("§1 In the stone ther are DIAMONDS!! "); } else if(rnd 6){ clientMessage("§3 Flowers for You!!"); //drops flowers(bullsh*t) Level.dropItem(x,y,z,0,38,9,1); Level.dropItem(x,y,z,0,38,1,3); Level.dropItem(x,y,z,0,38,2,2); Level.dropItem(x,y,z,0,38,5,4); Level.dropItem(x,y,z,0,38,4,5); Level.dropItem(x,y,z,0,38,3,6); Level.dropItem(x,y,z,0,38,8,7); Level.dropItem(x,y,z,0,38,7,8); } } else if(block 247){ preventDefault(); Level.setTile(x, y, z, 0); var rnd = random(0, 2); if(rnd 0){ var cordx = getPlayerX(); var cordy = getPlayerY(); var cordz = getPlayerZ(); Level.setTile(x+10,y+2,z, 46,1); Level.setTile(x,y,z, 46,1); Level.setTile(x+6,y,z, 46,1); Level.setTile(x+8,y,z, 46,1); Level.setTile(x+5,y,z, 46,1); Level.setTile(x,y+2,z, 46,1); Level.setTile(x+7,y,z, 46,1); Level.setTile(x,y,z, 46,1); Level.setTile(x,y,z+5, 46,1); Level.setTile(x,y,z+9, 46,1); Level.setTile(x,y,z+8, 46,1); Level.setTile(x+5,y,z+6, 46,1); Level.setTile(x+3,y+3,z-7, 46,1); Level.setTile(x-8,y,z, 46,1); Level.setTile(x-5,y,z-8, 46,1); Level.setTile(x-4,y,z-8, 46,1); Level.setTile(x+6,y,z-6, 46,1); Level.setTile(x-9,y,z, 46,1); Level.setTile(x-4,y,z-3, 46,1); Level.setTile(x,y+2,z, 46,1); //puts tnt thet will flint it self when broken :D troll! } else if(rnd 1){ var cx = getPlayerX(); var cy = getPlayerY(); var cz = getPlayerZ(); Level.setTile(cx,cy+60,cz,145,1 ); Level.setTile(cx+1,cy+40,cz,145,1 ); Level.setTile(cx-1,cy+40,cz,145,1 ); Level.setTile(cx,cy+40,cz-1,145,1 ); Level.setTile(cx,cy+40,cz+1,145,1 ); clientMessage("DON'T MOVE I WILL DROP SOME DIAMONDS!"); Level.dropItem(getPlayerX(),getPlayerY()+10,getPlayerZ(),0,264,5,0); //drops diamonds and sets anvils up in the air !! TROLLLL!!! Level.setTile(); } else if(rnd 2){ var rnd = random(1,6); Level.dropItem(x,y+20,z,0,322,rnd,0); //drops from 0-6 golden apples } } else if(block 240){ preventDefault(); Level.setTile(x, y, z, 0); var rnd = random(0, 5); //random nubmer generator(var) if(rnd 0){ var a = random(1,5); Level.dropItem(x,y,z,0,56,a,0); Level.dropItem(x,y,z,0,58,1,0); Level.dropItem(x,y,z,0,60,a,0); Level.dropItem(x,y,z,0,79,4,0); Level.dropItem(x,y,z,0,83,a,0); Level.dropItem(x,y,z,0,86,2,0); //garvige if(a 1){ Level.dropItem(x,y,z,0,92,1,0); Level.dropItem(x,y,z,0,97,6,0); Level.dropItem(x,y,z,0,100,4,0); Level.dropItem(x,y,z,0,103,7,0); Level.dropItem(x,y,z,0,112,8,0); //more garvige Level.dropItem(x,y,z,0,120,4,0); } else if(a 2){ var rnd = random(0, 4); Level.dropItem(x,y,z,0,116,1,0); Level.dropItem(x,y,z,0,117,1,0); Level.dropItem(x,y,z,0,145,1,0); Level.dropItem(x,y,z,0,22,5,0); //GREAT STUFF!!!!!! but only 1/5 and then again 1/5 chanse SO ONLY 1/25 chanse BUT IT WILL SPAWN LAVA 3 BLOCKS OVER IT!!! Level.dropItem(x,y,z,0,276,1,0); Level.setTile(x,y+3,z,10,1); Level.setTile(x,y+2,z,11,1) } else if(rnd 0){ Level.dropItem(x,y,z,0,3,16); //more garvige :D! } else{ Level.dropItem(x,y,z,0,240,1,0) //retrns lucky block } } else if(rnd 3){ Level.dropItem(x,y,z,0,74,3,0); //more garvige ! Level.dropItem(x,y,z,0,73,2,0); Level.dropItem(x,y,z,0,81,7,0); Level.dropItem(x,y,z,0,329,1,0); } else if(rnd 4){ Level.dropItem(x,y,z,0,1,7,0); //more garvige expect bow and arrows! Level.dropItem(x,y,z,0,261,1,0); Level.dropItem(x,y,z,0,262,16,0); Level.dropItem(x,y,z,0,17,4,0); } else if(rnd 5){ Level.dropItem(x,y,z,0,12,16,0); Level.dropItem(x,y,z,0,7,1,0); Level.dropItem(x,y,z,0,11,2,0); Level.dropItem(x,y,z,0,37,5,0); } } else if(block 46){ Entity.addEffect(getPlayerEnt() , 2, 150, 6); } } function random(min, max){ return Math.floor(Math.random()*(max+1)+min); //random nubmer generator MAIN! } function procCmd(command){ var cmd = command.split(" "); if(cmd)0 "lucky"; if(cmd)1 "kit"; Player.addItemInventory(249, 64, 1); Player.addItemInventory(248, 64, 1); Player.addItemInventory(247, 64, 1); Player.addItemInventory(240, 64, 1); Player.addItemInventory(239,64,1); Player.addItemInventory(257, 64, 1); Player.addItemInventory(41, 64, 1); Player.addItemInventory(58, 4, 1); Player.addItemInventory(600,1,1); clientMessage("§6Your lucky stuff has been added!"); //comand "/lucky kit"gives to player lucky blocks and iron pick! }